<?php

include(APPPATH.'utils/simple_html_dom.php');
/**
 * Created by PhpStorm.
 * User: motus
 * Date: 2017/3/26
 * Time: 11:07
 */
class http_model extends CI_Model {


    function __construct() {
        parent::__construct();

    }

    /*
     *
     */
    function filmIndex() {
        $url='http://louzhu.dppapapa.com/';
// 新建一个Dom实例
        $html = new simple_html_dom();

// 从url中加载
        $html->load_file($url);

//
        $ret = $html->find('li.new-nav-item');

        $str = '';
        foreach ($ret as $r){
            $a = $r->find('a',0);
            $str = $str.$a->href.'------------------------------------------';
        }
//        $html = file_get_contents($url);
        return $str;
    }
}